﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Data;
using Kingdee.BOS;
using Kingdee.BOS.Util;
using Kingdee.BOS.Core;
using Kingdee.BOS.Core.DynamicForm.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Core.Report;
using Kingdee.BOS.Core.Report.PlugIn;
using Kingdee.BOS.Core.Report.PlugIn.Args;
using Kingdee.BOS.Core.Bill;
using Kingdee.BOS.Core.DynamicForm;
using Kingdee.BOS.Core.Metadata;
using Kingdee.BOS.Core.SqlBuilder;
using Kingdee.BOS.ServiceHelper;
using Kingdee.BOS.Contracts.Report;
using Kingdee.BOS.Orm.DataEntity;
using Kingdee.BOS.App.Data;

namespace KD_DMG_ZLFXBILL
{
     [Description("应收账报表金额字段显示千分位")]
    public class YSZLBILLEdit : AbstractSysReportPlugIn
    {
         public override void FormatCellValue(Kingdee.BOS.Core.Report.PlugIn.Args.FormatCellValueArgs args)
         {

             base.FormatCellValue(args);

             if (!args.Header.FieldName.EqualsIgnoreCase("id") && !args.Header.FieldName.EqualsIgnoreCase("FCustNumber") && !args.Header.FieldName.EqualsIgnoreCase("FCustName") && !args.Header.FieldName.EqualsIgnoreCase("FYWNumber") && !args.Header.FieldName.EqualsIgnoreCase("FYWName")
                 && !args.Header.FieldName.EqualsIgnoreCase("FXMNumber") && !args.Header.FieldName.EqualsIgnoreCase("FXMName"))
             {
                 args.FormateValue = String.Format("{0:N}", args.Value);
             }


         }

         public override void OnFormatRowConditions(ReportFormatConditionArgs args)
         {
             base.OnFormatRowConditions(args);
             //行背景色：

             FormatCondition fc = new FormatCondition();

             if (args.DataRow["FACCOUNTBOOKName"].ToString().Contains("小计"))
             {

                 fc.BackColor = "#ADFF2F";// 背景色蓝色;

             }
             if (args.DataRow["FACCOUNTBOOKName"].ToString().Contains("合计"))
             {

                 fc.BackColor = "#ADFF2F";// 背景色蓝色;

             }
             args.FormatConditions.Add(fc);
         }
    }
}
